package cosc617_blackteam;

import java.util.Iterator;
/**
 * 
 * @author sherbahadur
 *This class can be described as strategy based on first in and first out
 *a simple queue from JAVA API is implemented 
 *
 *Edit by lsemesky - the original orderList needs to be changed 
 *and since no sorting needs to be done I've simplified things a bit
 *also now taking prep time into account
 */
public class PrepByFIFO implements I_CookingStrategy {
private OrderCollections orderList;
private Iterator<Order> iterator;
	public PrepByFIFO(OrderCollections orders){
		this.orderList=orders;
	}
	public void prepareFood() {
		/**
		 * put the order in the queue
		 */
		//get all of the unmade orders
		iterator = orderList.unmadeIterator();
		if(iterator.hasNext()){
			Order currentOrder = iterator.next();
			currentOrder.decrementCookTime();
			
		}
	}


}
